<header data-am-widget="header" class="am-header am-header-default sq-head ">
	<div class="am-header-left am-header-nav">
		<a href="javascript:history.back()" class="">
			<i class="am-icon-chevron-left"></i>
		</a>
	</div>
	<h1 class="am-header-title">
		<a href="" class="">管理收货地址</a>
	</h1>
	<div class="am-header-right am-header-nav">
		<a href="{:url('index/ReapRess/ress')}" class="">
			<i class="am-icon-plus"></i>
		</a>
	</div>
</header>
<div style="height: 49px;"></div>
<ul class="address-list">
	{volist name='ress' id='row'}
	<li class="curr">
		<p>收货人：{$row.ress_name}&nbsp;&nbsp;{$row.ress_phone}</p>
		<p class="order-add1" style="color: #212121;">收货地址：{$row.ress_content}</p>
		<hr/>
		<div class="address-cz">
			<label class="am-radio am-warning">
				<input type="radio" class="edit" name="checked" rid="{$row.rid}" data-am-ucheck {$row.checked==1 ?
				'checked' :''}> <span style="color: #FFB800">设为默认</span>
			</label>
			<a href="{:url('index/ReapRess/editRess',['rid'=>$row.rid])}" style="color: #393D49;"><img src="__STATIC__/images/bj.png" width="18"/>&nbsp;编辑</a>
			<a class="del" style="color: #FF794E;">删除</a>
		</div>
	</li>
	{/volist}
</ul>
<script>
    layui.use('form', function () {
        var form = layui.form;
        $('.edit').click(function () {
            rid = $(this).attr('rid');
            $.post("{:url('index/ReapRess/defaultRess')}", {rid: rid}, function () {
            });
        })
        $('.del').click(function () {
            rid = $(this).siblings('label').children('input').attr('rid');
            $.post("{:url('index/ReapRess/delRess')}", {rid: rid}, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg(res.msg, {icon: 9}, function () {
                    });
                }
            });
        })
    });
</script>